package com.sftz.modules.minapp.home.module;

import java.util.HashMap;
import java.util.Map;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;

import com.sftz.modules.minapp.home.form.HomeForm;
import com.sftz.modules.minapp.home.service.HotrecommendViewService;
import com.uxuexi.core.db.dao.IDbDao;

/**
*
* @author   赵硕
* @Date	 2018年1月15日 	 
*/

@IocBean
@At("/wx")
@Filters
public class HotrecommendModule {

	private static final Log log = Logs.get();

	@Inject
	private HotrecommendViewService hotrecommendViewService;

	@Inject
	private IDbDao dbDao;

	/**
	 *（用途:首页加载查询课程分类及轮播图）
	 */
	@At
	@Ok("json")
	public Object homeScarouseAndcourTypeData() {
		Map<String, Object> map = new HashMap<String, Object>();
		//轮播图
		map.put("scarouse", hotrecommendViewService.homeCarouseData());
		//课程分类
		/*map.put("courseType", hotrecommendViewService.homeCourseTypeList());*/

		return map;
	}

	/**
	 * （用途:首页学历课程、非学历课程)
	 */
	@At
	@Ok("json")
	public Object homeCourseListData() {

		Object homeCourseList = hotrecommendViewService.homeCourseList();

		return homeCourseList;
	}

	/**
	 *（用途:首页加载查询推荐专业及人气老师）
	 */
	@At
	@Ok("json")
	public Object homeMajorAndBigVData(@Param("..") final HomeForm form) {

		Map<String, Object> map = new HashMap<String, Object>();
		//推荐专业
		map.put("seriesCouList", hotrecommendViewService.homeMajorListData());
		//人气老师
		map.put("bigVList", hotrecommendViewService.homeBigVData(form));

		return map;
	}
}